<!Doctype html><html xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta http-equiv=Content-Type content="text/html;charset=utf-8">
</head>
</html>

<?php
/*PriceMonitor*/



$f = new SaeFetchurl();
$f->setCookie("PHPSESSID","8345f0f3333342b2186bd6c333375e7c");
$f->setCookie("jy_uid","1415108512345678901879007A9D31E3");
$f->setCookie("ntts_kb_session_id","22222222");
$f->setCookie("ntts_message_tips_status","1000000");
$f->setHeader("Referer","http://i.iqiyi.com/");
$content = $f->fetch('https://jiaoyi.yunfan.com/index.php/merchandise/get_stat_top_five?rand=0.16818360658362508');
// echo $content."</p></p>";

$buyContent="Null";
$sellContent="Null";
$dealContent="Null";
// echo "done!</p>";
// $rule ='continous(.*?),';  
// preg_match_all($rule,$content,$result);  
// echo $result[0][0];  



preg_match('/"buy":\[(.*?)\],"sell":\[(.*?)\],"deal":\[(.*?)\],/',$content, $matches);
$buyContent = $matches[1];
$sellContent = $matches[2];
$dealContent = $matches[3];

// echo $buyContent."</p></p>";
// echo $sellContent."</p></p>";
// echo $dealContent."</p></p>";

preg_match_all('/\{"price":"(.*?)","mineral":(\d*?)\}/',$sellContent, $matches_sell);
echo "出售价：</p>";
for ($i=0; $i< count($matches_sell[0]); $i++) {
echo $matches_sell[1][$i].":";
echo $matches_sell[2][$i]."</p>";
}


preg_match_all('/\{"price":"(.*?)","mineral":(\d*?)\}/',$buyContent, $matches_buy);
echo "收购价：</p>";
for ($i=0; $i< count($matches_buy[0]); $i++) {
echo $matches_buy[1][$i].":";
echo $matches_buy[2][$i]."</p>";
}


preg_match_all('/\{"deal_time":"(.*?)","price":"(.*?)","mineral":"(.*?)"\}/',$dealContent, $matches_deal);
echo "成交情况：</p>";
for ($i=0; $i< count($matches_deal[0]); $i++) {
echo $matches_deal[1][$i]."              ";
echo $matches_deal[2][$i]."   :   ";
echo $matches_deal[3][$i]."</p>";
}

/*


{"price":"1.95","mineral":9688},{"price":"1.92","mineral":118},{"price":"1.91","mineral":3464},{"price":"1.90","mineral":9646},{"price":"1.89","mineral":3095}

{"price":"1.96","mineral":51213},{"price":"1.97","mineral":33773},{"price":"1.98","mineral":31219},{"price":"1.99","mineral":17606},{"price":"2.00","mineral":100743}

{"deal_time":"15:14:04","price":"1.95","mineral":"36"},{"deal_time":"15:14:02","price":"1.95","mineral":"100"},{"deal_time":"15:13:56","price":"1.95","mineral":"176"},{"deal_time":"15:13:55","price":"1.95","mineral":"24"},{"deal_time":"15:13:47","price":"1.95","mineral":"138"}




{"ok":true,"reason":"","data":{"buy":[{"price":"1.87","mineral":2001},{"price":"1.86","mineral":674},{"price":"1.85","mineral":7463},{"price":"1.84","mineral":26},{"price":"1.83","mineral":9}],"sell":[{"price":"1.88","mineral":1170},{"price":"1.89","mineral":1553},{"price":"1.90","mineral":3681},{"price":"1.91","mineral":3771},{"price":"1.92","mineral":9969}],"deal":[{"deal_time":"09:02:52","price":"1.86","mineral":"6"},{"deal_time":"09:02:52","price":"1.88","mineral":"176"},{"deal_time":"09:02:51","price":"1.87","mineral":"24"},{"deal_time":"09:02:51","price":"1.87","mineral":"200"},{"deal_time":"09:02:51","price":"1.87","mineral":"2776"}],"config":{"id":"312","starttime":"1396054800","endtime":"1396083600","status":"1","configdate":"1396022400","now":1396055010}}



{
    "ok": true,
    "reason": "",
    "data": {
        "buy": [
            {
                "price": "1.87",
                "mineral": 2001
            },
            {
                "price": "1.86",
                "mineral": 674
            },
            {
                "price": "1.85",
                "mineral": 7463
            },
            {
                "price": "1.84",
                "mineral": 26
            },
            {
                "price": "1.83",
                "mineral": 9
            }
        ],
        "sell": [
            {
                "price": "1.88",
                "mineral": 1170
            },
            {
                "price": "1.89",
                "mineral": 1553
            },
            {
                "price": "1.90",
                "mineral": 3681
            },
            {
                "price": "1.91",
                "mineral": 3771
            },
            {
                "price": "1.92",
                "mineral": 9969
            }
        ],
        "deal": [
            {
                "deal_time": "09:02:52",
                "price": "1.86",
                "mineral": "6"
            },
            {
                "deal_time": "09:02:52",
                "price": "1.88",
                "mineral": "176"
            },
            {
                "deal_time": "09:02:51",
                "price": "1.87",
                "mineral": "24"
            },
            {
                "deal_time": "09:02:51",
                "price": "1.87",
                "mineral": "200"
            },
            {
                "deal_time": "09:02:51",
                "price": "1.87",
                "mineral": "2776"
            }
        ],
        "config": {
            "id": "312",
            "starttime": "1396054800",
            "endtime": "1396083600",
            "status": "1",
            "configdate": "1396022400",
            "now": 1396055010
        }
    }





*/





?>